#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
struct node
{
	float x,y;
	float dist;
};

bool cmp(node a,node b)
{
	return a.x<b.x;
}
int main()
{
	int t;
	cin>>t;
		for(int g=0;g<t;g++){
			int n,w,h;
			node src[1001];
			cin>>n>>w>>h;
			int a[1001];
			int b[1001];
			for(int i=0;i<n;i++) cin>>a[i]>>b[i];
			
			for(int j=0;j<n;j++){
				if(b[j]*2<=h){
					src[j].x=src[j].y=b[j];
					continue;
				}
				src[j].x=a[j]-sqrt(b[j]*b[j]-h*h/4);
				src[j].y=a[j]+sqrt(b[j]*b[j]-h*h/4);
				src[j].dist=sqrt(b[j]*b[j]-h*h/4)*2;
			}
			sort(src,src+n,cmp);
			float start=0;
			int count=0;
			for(int position=0;position<n;position++){
				if(src[position].x<=start){
					float now=src[position].y;
					while(src[position].x<=start){
						now=src[position].y>now?src[position].y:now;
						position++;
						if(position==n) break;
					}
					start=now;
					position--;
					count++;
				}
				if(start>=w) break;
			}
			
			
			if(start>=w) cout<<count<<endl;
			else cout<<0<<endl;
			
		}
		
	return 0;
}
